var crypto = require('crypto'),
	config = require('../config');
/*
*	加密
*/
module.exports.encrypto = function(str){
    var cipher = crypto.createCipher('aes192', config.key);  
    var enc = cipher.update(str,'utf8','hex');  
    enc += cipher.final('hex');  
    return enc;  
}

/*
*	解密
*/
module.exports.decrypto = function(str) {  
    var decipher = crypto.createDecipher('aes192', config.key);  
    var dec = decipher.update(str,'hex','utf8');  
    dec += decipher.final('utf8');
    return dec;  
}

